home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / ATOF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  351 b   |  17 lines

  1. /* atof.c, from p.170 of Turbo C Bible  */
  2. /* Converts a string to a double-precision floating-point value. */
  3. #include <stdio.h>
  4. #include <math.h>
  5. main(int argc, char **argv)
  6. {
  7.     double value;
  8.     if(argc < 2)
  9.     {
  10.         printf("Usage: %s <value>\n", argv[0]);
  11.     }
  12.     else
  13.     {
  14.         value = atof(argv[1]);
  15.         printf("Value entered = %g\n", value);
  16.     }
  17. }